package com.zjy.service.impl;

import com.zjy.bean.GoodsDetail;
import com.zjy.dao.GoodsDetailMapper;
import com.zjy.service.GoodsDetailService;
import com.zjy.utils.UUIDUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by Administrator on 2019/5/15.
 */
@Service
public class GoodsDetailServiceImpl implements GoodsDetailService {
    @Resource
    private GoodsDetailMapper goodsDetailMapper;

    @Override
    public GoodsDetail selectByGoodsId(String goodsId) {
        return goodsDetailMapper.selectByGoodsId(goodsId);
    }

    @Override
    public void addGoodsDetail(GoodsDetail goodsDetail) {
        goodsDetail.setId(UUIDUtils.getUUID());
        goodsDetailMapper.insertSelective(goodsDetail);
    }

    @Override
    public int updateGoodsDetailById(GoodsDetail goodsDetail) {
        return goodsDetailMapper.updateByPrimaryKeySelective(goodsDetail);
    }
}
